package org.grow.yc.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.grow.yc.dao.DepartmentMapper;
import org.grow.yc.entity.QueryCondition;
import org.grow.yc.entity.dto.DepartmentXDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: xwg
 * @CreateDate: 2024/10/16
 */

@RestController
@RequestMapping("/employee")
public class EmployeeController {


    @Autowired
    private DepartmentMapper departmentMapper;

    @PostMapping("/queryDepartmentX")
    public IPage<DepartmentXDto> queryDepartmentX(@RequestBody QueryCondition queryCondition) {
        Page<DepartmentXDto> of = Page.of(queryCondition.getPageNum(), queryCondition.getPageSize());
        return departmentMapper.findXByDepartmentAll(of);
    }
}
